.container {
  position: relative;
  width: 100%;
}

.trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 100%;
  height: 32px;
  padding: 8px 12px;
  cursor: pointer;
  border: 1px solid var(--overlay-20);
  border-radius: 6px;
  transition: border-color 0.2s ease;
}

.trigger:hover {
  border-color: var(--overlay-30);
}

.trigger:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--primary-accent);
}

.trigger.error {
  border-color: var(--danger-overlay-40);
}

.trigger.error:hover {
  border-color: var(--danger-overlay-60);
}

.trigger.error:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--severity-critical-40);
}

.trigger.disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.trigger.disabled:hover {
  border-color: var(--overlay-20);
}

.content {
  display: flex;
  flex: 1;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.branchIcon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: var(--overlay-60);
}

.branchName {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: var(--font-size-2);
  color: var(--global-foreground);
  text-align: left;
  white-space: nowrap;
}

.chevronIcon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: var(--overlay-60);
  transition: transform 0.2s ease;
}

.chevronIcon.open {
  transform: rotate(180deg);
}

.dropdown {
  position: fixed;
  z-index: var(--z-index-dropdown-menu);
  min-width: 200px;
  margin-top: 4px;
  background: var(--global-background);
  border: 1px solid var(--dropdown-border);
  border-radius: var(--border-radius-base);
  box-shadow: 0 4px 20px 0 rgb(0 0 0 / 40%);
}

.dropdown.error {
  border-color: var(--danger-overlay-40);
  box-shadow: 0 4px 20px 0 var(--severity-critical-40);
}

.searchContainer {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--overlay-10);
}

.searchIcon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: var(--overlay-60);
}

.searchInput {
  flex: 1;
  font-size: var(--font-size-2);
  color: var(--global-foreground);
  outline: none;
  background: transparent;
  border: none;
}

.searchInput:focus-visible {
  outline: none;
}

.searchInput::placeholder {
  color: var(--overlay-60);
}

.errorMessage {
  padding: var(--spacing-4) var(--spacing-3);
  font-size: var(--font-size-2);
  color: var(--danger-high-contrast-text);
  text-align: center;
}

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-4) var(--spacing-3);
}

.list {
  max-height: 200px;
  overflow-y: auto;
}

.item {
  display: flex;
  gap: var(--spacing-2);
  align-items: center;
  height: 32px;
  padding: var(--spacing-2);
  font-size: var(--font-size-2);
  cursor: pointer;
  background: var(--global-background);
  border-radius: var(--border-radius-base);
  transition: background-color var(--default-hover-animation-duration)
    var(--default-timing-function);
}

.item:hover,
.item:focus {
  background-color: var(--dropdown-background-hover);
}

.item:focus-visible {
  outline: none;
}

.item[data-selected='true'] {
  background-color: var(--dropdown-background-active);
}

.item.selected {
  background-color: var(--dropdown-background-active);
}

.itemIcon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: var(--overlay-60);
}

.itemLabel {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--global-foreground);
  white-space: nowrap;
}

.empty {
  padding: var(--spacing-4) var(--spacing-3);
  font-size: var(--font-size-2);
  color: var(--overlay-60);
  text-align: center;
}
